﻿//JumbotCms_4.1 Final
using System;
using System.Data;
using System.Web;
using Jumbot.Common;
namespace JumbotCms.Extends.Feedback
{
    public partial class _toplist : JumbotCms.Common.BasicPage
    {
        private string _response = string.Empty;

        protected void Page_Load(object sender, EventArgs e)
        {
            int PSize = (Str2Int(q("pagesize"), 0) < 1 || Str2Int(q("pagesize"), 0) > 20) ? 10 : Str2Int(q("pagesize"), 0);
            int page = Int_ThisPage();
            string classid = Str2Str(q("classid"));
            int countNum = 0;
            string sqlStr = "";
            string whereStr = "[ParentId]=0 AND [ClassId]=" + classid;
            doh.Reset();
            doh.ConditionExpress = whereStr;
            countNum = doh.Count("jcms_extends_feedback");
            sqlStr = Jumbot.Common.staticFunction.GetSql("Id,Title", "jcms_extends_feedback", "Id", PSize, page, "desc", whereStr);
            doh.Reset();
            doh.SqlCmd = sqlStr;
            DataTable dtFeedback = doh.GetDataTable();
            string ResponseStr = "<ul>";
            for (int j = 0; j < dtFeedback.Rows.Count; j++)
            {
                ResponseStr += "<li><a href=\"" + site.Dir + "extends/feedback/index.aspx?classid=" + classid + "\" target=\"_blank\">" + dtFeedback.Rows[j]["Title"].ToString() + "</a></li>";
            }
            ResponseStr += "</ul>";
            dtFeedback.Clear();
            dtFeedback.Dispose();
            if (q("act") == "ajax")
                Response.Write(ResponseStr);
            else
                Response.Write(Jumbot.Common.Strings.Html2Js(ResponseStr));
        }
    }
}
